﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynamicToSql
{
    public sealed class Expression
    {
        private Expression()
        {
            
        }

        internal Expression(Property property, ComparisonOperator comparisonOperator)
        {
            this.Property = property;
            this.ComparisonOperator = comparisonOperator;
            this.Values = new List<object>();
        }

        public static Criteria operator &(Expression expression1, Expression expression2)
        {
            var qc = new Criteria(BooleanOperator.And);
            qc.Add(expression1);
            qc.Add(expression2);
            return qc;
        }

        public static Criteria operator |(Expression expression1, Expression expression2)
        {
            var qc = new Criteria(BooleanOperator.Or);
            qc.Add(expression1);
            qc.Add(expression2);
            return qc;
        }

        internal Property Property { get; set; }
        
        internal ComparisonOperator ComparisonOperator { get; set; }

        internal IList<object> Values { get; set; }

    }
}
